using Project.ViewModels.Abstractions;
using UnityEngine;

namespace Project.Views.Abstractions
{
    public abstract class MonoUIViewBase : MonoBehaviour, IView { }
    public abstract class MonoUIViewBase<T> : MonoBehaviour, IView where T : IViewModel 
    {
        protected T ViewModel { get; private set; }
        protected RootUIView RootUIView { get; private set; }

        public void Initialize(T viewModel, RootUIView rootUIView)
        {
            ViewModel = viewModel;
            RootUIView = rootUIView;

            OnAfterInitialization();
        }

        protected virtual void OnAfterInitialization() { }
    }
}
